<?php namespace system\model;

use hdphp\Model\Model;

class PluginWebCatgory extends Model
{
	//数据表
	protected $table = "plugin_web_catgory";
	protected $allowFill = [ '*' ];

	//自动验证
	protected $validate=[
		['name','required','栏目名称不能为空',self::MUST_VALIDATE,self::MODEL_BOTH],
		// ['pid','required','所属栏目不能为空',self::MUST_VALIDATE,self::MODEL_BOTH],
	];

	//自动完成
	protected $auto=[
		//['字段名','处理方法','方法类型',验证条件,验证时机]
	];

	public function dataTree()
	{
		$data=$this->get()->toArray();
		return Data::tree($data, 'name');
	}
}